﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework;

namespace Projektet.Model
{
    class HumanPlayer : Player
    {
        public Catapult _catapult;

        public HumanPlayer(PlayerType playerType, EventListener eventListener, Vector2 startPos, int levelCount)
        {
            _playerType = playerType;
            _position = startPos;
            _spawnPosition = new Vector2(_position.X + 20, _position.Y);

            _castle = new Castle(_playerType, eventListener, _position);
            _unitList.Add(_castle);
            _spawnPosition.X -= 3;

            _levelCount = levelCount;
            if(levelCount > 1)
            {
                _catapult = new Catapult(new Vector2(_position.X, _position.Y + 10f));
            }
            _gold = 500;
            _goldIncome = 10;
            
            //_unitList.Add(new Pikeman(new Vector2(), 1f, 0.03f));
            //_unitList.Add(new Archer(_playerType, new Vector2(), 1f));
        }

        public void SpecificUpdate(GameTime gameTime, List<CombatUnit> unitList) 
        {
            if(_levelCount > 1)
            {
                _catapult.Update(gameTime, unitList);
            }
        }       
    }
}
